﻿
/*============== simpleIRC - http://matthias.van-eeghem.com/ ==============*
 *                                                                         *
 *  File: Interface.cs                                                     *
 *  Project: simpleIRC                                                     *
 *  Author(s);: Matthias Van Eeghem <matthias@van-eeghem.com>               *
 *                                                                         *
 * ========================================================================*
 *                                                                         *
 *  This program is free software: you can redistribute it and/or modify   *
 *  it under the terms of the GNU General Public License as published by   *
 *  the Free Software Foundation, either version 3 of the License, or      *
 *  (at your option); any later version.                                    *
 *                                                                         *
 *  This program is distributed in the hope that it will be useful,        *
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
 *  GNU General Public License for more details.                           *
 *                                                                         *
 *  You should have received a copy of the GNU General Public License      *
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.  *
 *                                                                         *
===========================================================================*/

namespace simpleIRC.UI
{
    /// <summary>
    /// The plugin interface
    /// </summary>
    
    public interface PluginInterface
    {
        /// <summary>
        /// Called when the plugin gets loaded by the application.
        /// </summary>
        /// <param name="mainWindowRef">The reference to the instance of the MainWindow object</param>
        
        void OnBasePluginLoad(object mainWindowRef);

        /// <summary>
        /// Called when the plugin is loaded
        /// </summary>

        void OnPluginLoad();

        /// <summary>
        /// Called when the plugin is unloaded
        /// </summary>

        void OnPluginUnload();

        /// <summary>
        /// Called when a message is sent to a channel the client is on
        /// </summary>
        /// <param name="channelName">The name of the channel</param>
        /// <param name="serverIndex">The server index the channel is on</param>
        /// <param name="userName">The user who sent a message</param>
        /// <param name="message">The message the user sent</param>

        void OnMessageSent(string channelName, int serverIndex, string userName, string message);

        /// <summary>
        /// Called when somebody joins a channel the client is on
        /// </summary>
        /// <param name="channelName">The channel that was joined</param>
        /// <param name="serverIndex">The server index the channel is on</param>
        /// <param name="userName">The name of the userName that joined</param>

        void OnJoinSent(string channelName, int serverIndex, string userName);

        /// <summary>
        /// Called when somebody parts a channel the client is on
        /// </summary>
        /// <param name="channelName">The channel that was parted</param>
        /// <param name="serverIndex">The server index the channel is on</param>
        /// <param name="userName">The name of the user that parted</param>
        /// <param name="highestLevel">The highest level (if any) the user had before parting the channel</param>
        /// <param name="reason">An optional reason of why the userName parted the channelName</param>

        void OnPartSent(string channelName, int serverIndex, string userName, string highestLevel, string reason);

        /// <summary>
        /// Called when a user quits the server
        /// </summary>
        /// <param name="channelName">The channel the user quit</param>
        /// <param name="serverIndex">The server index the channel is on</param>
        /// <param name="nickName">The nickname of the user that quit the server</param>
        /// <param name="userName">The username of the user that quit the server</param>
        /// <param name="hostName">The hostname of the user that quit the server</param>
        /// <param name="highestLevel">The highest level (if any) the user had before parting the channel</param> 
        /// <param name="reason">The reason why he quit the server</param>

        void OnQuitSent(string channelName, int serverIndex, string nickName, string userName, string hostName, string highestLevel, string reason);

        /// <summary>
        /// Called when the client recevies the empty topic command from the server
        /// </summary>
        /// <param name="channelName">The channel name</param>
        /// <param name="serverIndex">The server index the channel is on</param>

        void OnEmptyTopic(string channelName, int serverIndex);

        /// <summary>
        /// Called when the client receives the topic command from the server
        /// </summary>
        /// <param name="channelName">The channel name</param>
        /// <param name="serverIndex">The server index the channel is on</param>
        /// <param name="topic">The channel topic</param>

        void OnFoundTopic(string channelName, int serverIndex, string topic);

        /// <summary>
        /// Called when the client receives the topic set by command from the server
        /// </summary>
        /// <param name="channelName">The channel name</param>
        /// <param name="serverIndex">The server index the channel is on</param>
        /// <param name="name">The name of the user that set the topic</param>
        /// <param name="timeSet">The time the topic was set in UNIX time</param>

        void OnTopicSetBy(string channelName, int serverIndex, string name, int timeSet);

        /// <summary>
        /// Called when the client receives the names list from the server
        /// </summary>
        /// <param name="channelName">The name of the channel</param>
        /// <param name="serverIndex">The server index the channel is on</param>
        /// <param name="namesList">An array of the users that are on the channel as strings</param>

        void OnNamesReceived(string channelName, int serverIndex, string[] namesList);

        /// <summary>
        /// Called when the topic is changed
        /// </summary>
        /// <param name="channelName">The channel name the topic was changed for</param>
        /// <param name="serverIndex">The server index the channel is on</param>
        /// <param name="userName">The user who changed the channel topic</param>
        /// <param name="newTopic">The new topic</param>

        void OnTopicChange(string channelName, int serverIndex, string userName, string newTopic);

        /// <summary>
        /// Called when the nickName of a userName changes
        /// </summary>
        /// <param name="channelName">The channel the user is on</param>
        /// <param name="serverIndex">The server index the channel is on</param>
        /// <param name="userName">The user that changed his or her name</param>
        /// <param name="newNick">The new nickName of the user</param>

        void OnNickChange(string channelName, int serverIndex, string userName, string newNick);

        /// <summary>
        /// This method is called when an URL for a channel is received
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="channelName">The channel the URL was received for</param>
        /// <param name="url">The actual URL</param>

        void OnChannelUrlReceived(int serverIndex, string channelName, string url);

        /// <summary>
        /// Called when a user sents a notice to a channel
        /// </summary>
        /// <param name="userName">The name of the user that sent the notice</param>
        /// <param name="channelName">The channel the notice was sent to</param>
        /// <param name="serverIndex">The server index the channel is on</param>
        /// <param name="message">The message that was sent</param>

        void OnChannelNotice(string userName, string channelName, int serverIndex, string message);

        /// <summary>
        /// Called when a userName sents a notice to the client
        /// </summary>
        /// <param name="userName">The name of the userName that sent the notice</param>
        /// <param name="serverIndex">The server index the userName is on</param>
        /// <param name="message">The message that was sent</param>

        void OnPrivateNotice(string userName, int serverIndex, string message);

        /// <summary>
        /// Called when a user sents a private message to the client
        /// </summary>
        /// <param name="userName">The user that sent the message</param>
        /// <param name="serverIndex">The server index the user is on</param>
        /// <param name="message">The message that was sent</param>

        void OnPrivateMessage(string userName, int serverIndex, string message);

        /// <summary>
        /// Called when a user sents an action in PM to the client
        /// </summary>
        /// <param name="userName">The user that sent the action</param>
        /// <param name="serverIndex">The server index</param>
        /// <param name="action">The action that was sent</param>

        void OnPrivateActionSent(string userName, int serverIndex, string action);

        /// <summary>
        /// Called when a channel mode is changed
        /// </summary>
        /// <param name="channelName">The channel for which the mode was changed</param>
        /// <param name="serverIndex">The server index the channel on</param>
        /// <param name="userName">The user that changed the mode</param>
        /// <param name="mode">The actual mode that was changed</param>
        /// <param name="names">An array of users the mode change had effect on</param>
        /// <param name="highestLevelBeforeModeChange">An array of strings containing the highest rights of each user in the names array before the mode change</param>

        void OnModeChange(string channelName, int serverIndex, string userName, string mode, string[] names, string[] highestLevelBeforeModeChange);

        /// <summary>
        /// Called when an action is sent to a channelName
        /// </summary>
        /// <param name="channelName">The channel the action was sent to</param>
        /// <param name="serverIndex">The server index the channel is on</param>
        /// <param name="userName">The user that sent the action</param>
        /// <param name="action">The action that was sent</param>

        void OnActionSent(string channelName, int serverIndex, string userName, string action);

        /// <summary>
        /// Called when a userName is kicked off a channelName
        /// </summary>
        /// <param name="channelName">The channel the user was kicked off</param>
        /// <param name="serverIndex">The server index the channel is on</param>
        /// <param name="kickerName">The user who kicked</param>
        /// <param name="kickeeName">The user who was kicked</param>
        /// <param name="highestLevelBeforeKick">The highest level the user had before being kicked from the channel</param>
        /// <param name="reason">The reason he was kicked for</param>

        void OnKickSent(string channelName, int serverIndex, string kickerName, string kickeeName, string highestLevelBeforeKick, string reason);

        /// <summary>
        /// Called when a user enters an invalid password when attempting to join a channel
        /// </summary>
        /// <param name="channelName">The channel the user tried to join</param>
        /// <param name="serverIndex">The server index the channel is on</param>
        /// <param name="message">The message the server sent back to the user</param>

        void OnInvalidPassword(string channelName, int serverIndex, string message);

        /// <summary>
        /// Called when a user is forwarded to another channel
        /// </summary>
        /// <param name="channelName">The channel the user originally tried to join</param>
        /// <param name="forward">The channel the user is forwarded to</param>
        /// <param name="serverIndex">The server index</param>
        /// <param name="message">The message the server sent</param>

        void OnChannelForward(string channelName, string forward, int serverIndex, string message);

        /// <summary>
        /// Called when a user cannot join a certain channel
        /// </summary>
        /// <param name="channelName">The channel the user couldn't join</param>
        /// <param name="serverIndex">The server index the channel is on</param>
        /// <param name="message">The reason why the user couldn't join the channel</param>

        void OnCannotJoin(string channelName, int serverIndex, string message);

        /// <summary>
        /// Called when the server sends the nickName already in use message
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="nickName">The nickname of the client</param>
        /// <param name="message">The message the server sent</param>

        void OnNameAlreadyInUse(int serverIndex, string nickName, string message);

        /// <summary>
        /// Called when the client receives the Motd
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="motdMessage">The actual message</param>

        void OnMotdReceive(int serverIndex, string motdMessage);

        /// <summary>
        /// Called when the client receives the start of the Motd
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="message">The actual message</param>

        void OnMotdStart(int serverIndex, string message);

        /// <summary>
        /// Called when a client receives the end of the Motd
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="message">The actual message</param>

        void OnMotdEnd(int serverIndex, string message);

        /// <summary>
        /// Called when the server sends information to the client
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="message">The actual message</param>

        void OnServerInformationReceived(int serverIndex, string message);

        /// <summary>
        /// Called when the server sends a list of supported commands to the client
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="commandsSupported">The actual message</param>

        void OnCommandsSupportedReceived(int serverIndex, string commandsSupported);

        /// <summary>
        /// Called when the user couldn't connect to the server
        /// </summary>
        /// <param name="serverIndex">The server index that didn't connect</param>
        /// <param name="errorCode">The error code</param>
        
        void OnConnectionFail(int serverIndex, int errorCode);

        /// <summary>
        /// Called when a connection is initialised
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        
        void OnConnectionInitialised(int serverIndex);

        /// <summary>
        /// Called when a client times out
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        
        void OnClientTimeout(int serverIndex);

        /// <summary>
        /// Called when the client receives the your host is event
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="hostName">The displayed hostName</param>

        void OnDisplayedHostReceived(int serverIndex, string hostName);

        /// <summary>
        /// Called when the user receives the PING reply from another client
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="nickName">The nick that sent the reply</param>
        /// <param name="ping">The time the command was sent (as epoch time);</param>

        void OnPingReplyReceived(int serverIndex, string nickName, string ping);

        /// <summary>
        /// Called when the user receives the TIME reply from another client
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="nickName">The nick that sent the reply</param>
        /// <param name="time">The time the command was sent (as epoch time);</param>

        void OnTimeReplyReceived(int serverIndex, string nickName, string time);

        /// <summary>
        /// Called when the user receives the VERSION reply from another client
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="nickName">The nick that sent the reply</param>
        /// <param name="version">The client version as string</param>

        void OnVersionReplyReceived(int serverIndex, string nickName, string version);

        /// <summary>
        /// Called when the server sends the 401 no such nick or channel message.
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="target">The nick or channel that couldn't be found</param>
        /// <param name="message">The message that was sent</param>

        void OnNoSuchNickOrChannel(int serverIndex, string target, string message);

        /// <summary>
        /// This event is called when the user joins a channel that doesn't exist
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="channelName">The (invalid) channel that was joined</param>
        /// <param name="message">The message that the server sent with the information</param>
        
        void OnNoSuchChannel(int serverIndex, string channelName, string message);

        /// <summary>
        /// Called when the client receives whether or not the target client is registered
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="nickName">The nick of the target client</param>
        /// <param name="message">The message</param>

        void OnRegisteredNickReceived(int serverIndex, string nickName, string message);

        /// <summary>
        /// Called when the client receives whether or not the target client is an operator
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="nickName">The nick of the target client</param>
        /// <param name="message">The message</param>

        void OnIsAvailableForHelpReceived(int serverIndex, string nickName, string message);

        /// <summary>
        /// Called when the client receives the user/host of the target client
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="nickName">The nick of the target client</param>
        /// <param name="name">The name of the client</param>
        /// <param name="hostName">The host of the target client</param>
        /// <param name="userName">The user of the target client</param>

        void OnWhoisInfoReceived(int serverIndex, string nickName, string name, string hostName, string userName);

        /// <summary>
        /// Called when the client receives the user is connecting to command
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="nickName">The nick of the target client</param>
        /// <param name="Server">The server the user is connected to</param>
        /// <param name="info">The info about the server</param>

        void OnUserConnectedFromReceived(int serverIndex, string nickName, string Server, string info);

        /// <summary>
        /// Called when the client receives the user is operator command
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="nickName">The nick of the target client</param>
        /// <param name="message">The message</param>

        void OnUserIsOperatorReceived(int serverIndex, string nickName, string message);

        /// <summary>
        /// Called when the client receives the idle command
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="nickName">The nick of the target client</param>
        /// <param name="idleTime">The amount of seconds the target client has been idling</param>
        /// <param name="signOnTime">The time the user signed on to the server</param>

        void OnUserIsIdlingReceived(int serverIndex, string nickName, int idleTime, int signOnTime);

        /// <summary>
        /// Called when the client receives end of whois command
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="nickName">The nick of the target client</param>
        /// <param name="message">The message</param>

        void OnEndOfWhoisReceived(int serverIndex, string nickName, string message);

        /// <summary>
        /// Called when the client receives the channels the target client is on
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="nickName">The nick of the target client</param>
        /// <param name="channelList">The channel list</param>

        void OnUsersOnChannelsReceived(int serverIndex, string nickName, string channelList);

        /// <summary>
        /// Called when the client receives the "logged in as" data from the target client
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="nickName">The nick of the target client</param>
        /// <param name="name">The name the target client is logged in as</param>
        /// <param name="message">The message</param>

        void OnUserIsLoggedInAsReceived(int serverIndex, string nickName, string name, string message);

        /// <summary>
        /// Called when the client receives the location the target client is connecting to
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="nickName">The nick of the target client</param>
        /// <param name="connectingFrom">The location</param>

        void OnUserConnectingFromReceived(int serverIndex, string nickName, string connectingFrom);

        /// <summary>
        /// Called when the client receives the modes the target client is using
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="nickName">The nick of the target client</param>
        /// <param name="modes">The modes list</param>

        void OnUserIsUsingModesReceived(int serverIndex, string nickName, string modes);

        /// <summary>
        /// Called when the client receives the unknown command command
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="command">The command that is unknown</param>
        /// <param name="message">The message that was sent</param>

        void OnUnknownCommandReceived(int serverIndex, string command, string message);

        /// <summary>
        /// Called when the client receives an invite to a channel
        /// </summary>
        /// <param name="serverIndex">The server index</param>
        /// <param name="nickName">The name of client that sent the invite</param>
        /// <param name="invitedTo">The channel the client was invited to</param>

        void OnInviteCommandReceived(int serverIndex, string nickName, string invitedTo);

        /// <summary>
        /// Called when the application is closing
        /// </summary>

        void OnApplicationClosing();

        /// <summary>
        /// Called when the user enters a command
        /// </summary>
        /// <param name="Command">The command the user entered</param>

        void OnCommandEntered(string Command);
    }
}
